<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

    

    <title>PostGreSQL 之服务器配置 | 钱猛的个人博客</title>
    <meta name="author" content="钱猛">
    
    <meta name="description" content="钱猛的个人博客。全栈发展向。无所谓做什么，只要是当前最感兴趣的事！随心、随性、随缘！">
    
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <meta property="og:title" content="PostGreSQL 之服务器配置"/>
    <meta property="og:site_name" content="钱猛 &amp; 博客"/>

    
    <meta property="og:image" content="undefined"/>
    

    <link rel="icon" type="image/png" href="/qianmeng/favicon.png">
    <link rel="alternate" href="/qianmeng/atom.xml" title="钱猛 &amp; 博客" type="application/atom+xml">
    <link rel="stylesheet" href="/qianmeng/css/lib/materialize.min.css">
    <link rel="stylesheet" href="/qianmeng/css/lib/font-awesome.min.css">
    <link rel="stylesheet" href="/qianmeng/css/style.css" media="screen" type="text/css">

    
        <link rel="stylesheet" href="/qianmeng/css/lib/prettify-tomorrow-night-eighties.css" type="text/css">
    
    <!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
	<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?fc7f849e9fbb3ea12b2683af4ccaa000";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

</head>


<body>
    <img src="/weixin_favicon.png" style="position: absolute; left: -9999px; opacity: 0; filter: alpha(opacity=0);">

    <nav class="indigo">
    <div class="nav-wrapper">
        <a href="#" data-activates="main-menu" class="button-collapse">
            <i class="fa fa-navicon"></i>
        </a>
        <div class="">
            <a href="/" class="brand-logo hide-on-med-and-down">钱猛 &amp; 博客 | 
			<span style="color:#E91E63;font-size:18px;">
			<i class="fa fa-flag"></i><span id="busuanzi_value_site_pv"></span>. 
			<i class="fa fa-user"></i><span id="busuanzi_value_site_uv"></span>
			</span> 
			</a> 
            <ul class="right hide-on-med-and-down">
                
                    <li>
                        <a class="menu-home " href="/qianmeng" >
                            <i class="fa fa-home "></i>
                            
                            首页
                        </a>
                    </li>
                
                    <li>
                        <a class="menu-archive " href="/qianmeng/archives" >
                            <i class="fa fa-archive "></i>
                            
                            归档
                        </a>
                    </li>
                
                    <li>
                        <a class="menu-category category-menu" href="javascript:;" data-activates="category-menu" >
                            <i class="fa fa-bookmark "></i>
                            
                            分类
                        </a>
                    </li>
                
                    <li>
                        <a class="menu-tag " href="/qianmeng/tags" >
                            <i class="fa fa-tag "></i>
                            
                            标签
                        </a>
                    </li>
                
                    <li>
                        <a class="menu-reading " href="/qianmeng/reading" >
                            <i class="fa fa-book "></i>
                            
                            读书
                        </a>
                    </li>
                
                    <li>
                        <a class="menu-about " href="/qianmeng/about" >
                            <i class="fa fa-user "></i>
                            
                            关于
                        </a>
                    </li>
                
                    <li>
                        <a class="menu-search modal-trigger " href="#search" >
                            <i class="fa fa-search "></i>
                            
                            搜索
                        </a>
                    </li>
                
            </ul>
            <div>
    <ul class="side-nav indigo darken-1" id="main-menu">
        
        <li class="side-user">
            <div class="row">
                <div class="col s4 no-padding">
                    <img class="avatar-image circle responsive-img" src="https://raw.githubusercontent.com/qianmeng/resources/master/head.jpg" alt="User Avatar">
                </div>
                <div class="info col s8 valign-wrapper no-padding">
                    <div class="valign">
                        <p class="name">钱猛</p>
                        <p class="desc">全栈工程师</p>
                    </div>
                </div>
            </div>
        </li>
        

        
            <li class="no-padding">
                <a class="waves-effect menu-home " href="/qianmeng" >
                    <i class="fa fa-home "></i>
                    
                    首页
                </a>
            </li>
        
            <li class="no-padding">
                <a class="waves-effect menu-archive " href="/qianmeng/archives" >
                    <i class="fa fa-archive "></i>
                    
                    归档
                </a>
            </li>
        
            <li class="no-padding">
                <a class="waves-effect menu-category category-menu" href="javascript:;" data-activates="category-menu" >
                    <i class="fa fa-bookmark "></i>
                    
                    分类
                </a>
            </li>
        
            <li class="no-padding">
                <a class="waves-effect menu-tag " href="/qianmeng/tags" >
                    <i class="fa fa-tag "></i>
                    
                    标签
                </a>
            </li>
        
            <li class="no-padding">
                <a class="waves-effect menu-reading " href="/qianmeng/reading" >
                    <i class="fa fa-book "></i>
                    
                    读书
                </a>
            </li>
        
            <li class="no-padding">
                <a class="waves-effect menu-about " href="/qianmeng/about" >
                    <i class="fa fa-user "></i>
                    
                    关于
                </a>
            </li>
        
            <li class="no-padding">
                <a class="waves-effect menu-search modal-trigger " href="#search" >
                    <i class="fa fa-search "></i>
                    
                    搜索
                </a>
            </li>
        
    </ul>

    <ul class="side-nav indigo darken-1" id="category-menu">
    

            

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/总结/">
                    总结 <span class="right">9 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/总结/个人总结/">
                    个人总结 <span class="right">2 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/总结/会展总结/">
                    会展总结 <span class="right">3 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/总结/个人技能/">
                    个人技能 <span class="right">2 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/总结/公司管理/">
                    公司管理 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/总结/编程经验/">
                    编程经验 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/面试/">
                    面试 <span class="right">6 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/面试/Android/">
                    Android <span class="right">3 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/面试/Python/">
                    Python <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/面试/web/">
                    web <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/面试/前端/">
                    前端 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/前端/">
                    前端 <span class="right">2 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/前端/AngularJs/">
                    AngularJs <span class="right">2 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/后台/">
                    后台 <span class="right">5 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/后台/Apache-CXF/">
                    Apache-CXF <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/后台/Apache-Http-Server/">
                    Apache-Http-Server <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/后台/Ehcache/">
                    Ehcache <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/后台/Hibernate/">
                    Hibernate <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/后台/MetaQ/">
                    MetaQ <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/架构/">
                    架构 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/架构/Hexo/">
                    Hexo <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/量化交易/">
                    量化交易 <span class="right">5 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/量化交易/Matlab/">
                    Matlab <span class="right">2 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/量化交易/股票/">
                    股票 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/量化交易/爬虫/">
                    爬虫 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/量化交易/期货/">
                    期货 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/数据库/">
                    数据库 <span class="right">5 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/数据库/PostGreSQL/">
                    PostGreSQL <span class="right">5 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/Android/">
                    Android <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/Android/Vollery/">
                    Vollery <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/IOS/">
                    IOS <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/IOS/itms-services/">
                    itms-services <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/网络/">
                    网络 <span class="right">2 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/网络/互联网协议/">
                    互联网协议 <span class="right">2 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/工具分享/">
                    工具分享 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/工具分享/系统工具/">
                    系统工具 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/微信/">
                    微信 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/微信/帐号区别/">
                    帐号区别 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/星座/">
                    星座 <span class="right">2 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/星座/归类/">
                    归类 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/星座/性格/">
                    性格 <span class="right">1 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-0" collapse-level="0">
                <a class="no-padding" href="/qianmeng/categories/美女/">
                    美女 <span class="right">17 篇</span></a>
                </a>
            </li>

        

            <li class="collapse-level-1" collapse-level="1">
                <a class="no-padding" href="/qianmeng/categories/美女/素人/">
                    素人 <span class="right">17 篇</span></a>
                </a>
            </li>

        

    </ul>
</div>

        </div>
    </div>
</nav>

<div id="search" class="modal search-modal">
    <div class="row">
        <div class="input-field col s12">
              <input id="search-input" type="text">
              <label for="search-input">搜索</label>
        </div>

    </div>
    <div id="search-result" class="search-result col s12">

    </div>
</div>


    <main>
        <div class="container main-container">
    
<nav class="page-nav hide-on-small-only">
    <div class="nav-wrapper indigo">
        <span class="breadcrumb">当前位置（分类目录）</span>
        
            
    
    
    <a class="breadcrumb" href="/qianmeng/categories/数据库/">数据库</a><a class="breadcrumb" href="/qianmeng/categories/数据库/PostGreSQL/">PostGreSQL</a>


        

        
    </div>
</nav>

<article>
    <div class="card">
        <div class="card-content">
            

            <div class="article-title">
                
    
        <h1>PostGreSQL 之服务器配置</h1>
    


            </div>
            <i class="fa fa-pencil-square"></i><time class="pink-link-context" datetime="2015-06-18T10:06:50.000Z"><a href="/qianmeng/2015/06/18/PostGreSQL 之服务器配置/">2015-06-18</a></time>

			<i class="fa fa-flag"></i><span id="busuanzi_value_page_pv"><i class="fa fa-spinner"></i></span> 人点击
            
    <div class="tags-row">
        
            <a href="/qianmeng/tags/PostGreSQL/" class="chip pink lighten-1">PostGreSQL</a>
        
            <a href="/qianmeng/tags/数据库/" class="chip pink lighten-1">数据库</a>
        
    </div>


            <div class="toc pink-link-context hide-on-med-and-down">
    <ol class="section table-of-contents"><li class="section table-of-contents-item section table-of-contents-level-4"><a class="section table-of-contents-link" href="#一-服务器进程的启动和关闭"><span class="section table-of-contents-text">一、服务器进程的启动和关闭</span></a></li><li class="section table-of-contents-item section table-of-contents-level-4"><a class="section table-of-contents-link" href="#二-服务器基本参数相关配置"><span class="section table-of-contents-text">二、服务器基本参数相关配置</span></a></li><li class="section table-of-contents-item section table-of-contents-level-4"><a class="section table-of-contents-link" href="#三-系统内存优化相关配置"><span class="section table-of-contents-text">三、系统内存优化相关配置</span></a></li><li class="section table-of-contents-item section table-of-contents-level-4"><a class="section table-of-contents-link" href="#四-常见问题参数举例"><span class="section table-of-contents-text">四、常见问题参数举例</span></a></li></ol>
</div>


            <div class="entry pink-link-context">
                <p>&#x65E2;&#x7136;&#x4F7F;&#x7528;&#x4E86;PostGreSQL&#xFF0C;&#x4EC5;&#x4EC5;&#x77E5;&#x9053;&#x5199;&#x5E38;&#x89C4;&#x7684;SQL&#x8BED;&#x53E5;&#x5566;&#xFF0C;&#x89C6;&#x56FE;&#x5566;&#xFF0C;&#x89E6;&#x53D1;&#x5668;&#x5566;&#x7B49;&#x7B49;&#xFF0C;&#x6BD5;&#x7ADF;&#x662F;&#x4E3B;&#x6D41;&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x6240;&#x4EE5;&#x8FD9;&#x4E9B;&#x548C;&#x5176;&#x4ED6;&#x6570;&#x636E;&#x5E93;&#x7CFB;&#x7EDF;&#x57FA;&#x672C;&#x4E0A;&#x5DEE;&#x4E0D;&#x591A;&#xFF0C;&#x5C31;&#x8FDE;&#x8BED;&#x6CD5;&#x90FD;&#x51E0;&#x4E4E;&#x4E00;&#x6837;&#xFF0C;&#x4E0D;&#x540C;&#x7684;&#x5C31;&#x5C5E;&#x6574;&#x4E2A;&#x7CFB;&#x7EDF;&#x7684;&#x67B6;&#x6784;&#x548C;&#x7CFB;&#x7EDF;&#x914D;&#x7F6E;&#x4E0D;&#x540C;&#x5566;&#xFF0C;&#x8FD9;&#x8FB9;&#x4E0D;&#x8C08;&#x67B6;&#x6784;&#xFF0C;&#x73B0;&#x5728;&#x7684;&#x6C34;&#x5E73;&#x4E5F;&#x6CA1;&#x6CD5;&#x8C08;&#xFF0C;&#x8FD8;&#x662F;&#x4ECE;&#x4F7F;&#x7528;&#x7684;&#x89D2;&#x5EA6;&#x6765;&#x770B;&#xFF0C;&#x8C08;&#x8C08;&#x5E38;&#x7528;&#x7684;&#x7CFB;&#x7EDF;&#x914D;&#x7F6E;&#x76F8;&#x5173;&#x6280;&#x672F;&#x5427;&#x3002;</p>
<p>&#x8FD9;&#x8FB9;&#x4E3B;&#x8981;&#x9488;&#x5BF9;&#x56DB;&#x90E8;&#x5206;&#x6765;&#x5177;&#x4F53;&#x8BF4;&#x8BF4;&#xFF0C;&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x7A0B;&#x7684;&#x542F;&#x52A8;&#x548C;&#x5173;&#x95ED;&#x3001;&#x670D;&#x52A1;&#x5668;&#x57FA;&#x672C;&#x53C2;&#x6570;&#x76F8;&#x5173;&#x914D;&#x7F6E;&#x3001;&#x7CFB;&#x7EDF;&#x5185;&#x5B58;&#x4F18;&#x5316;&#x76F8;&#x5173;&#x914D;&#x7F6E;&#x3001;&#x5E38;&#x89C1;&#x95EE;&#x9898;&#x53C2;&#x6570;&#x4E3E;&#x4F8B;&#x3002;<br><a id="more"></a></p>
<h4 id="&#x4E00;-&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x7A0B;&#x7684;&#x542F;&#x52A8;&#x548C;&#x5173;&#x95ED;"><a href="#&#x4E00;&#x3001;&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x7A0B;&#x7684;&#x542F;&#x52A8;&#x548C;&#x5173;&#x95ED;" class="headerlink" title="&#x4E00;&#x3001;&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x7A0B;&#x7684;&#x542F;&#x52A8;&#x548C;&#x5173;&#x95ED;"></a>&#x4E00;&#x3001;&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x7A0B;&#x7684;&#x542F;&#x52A8;&#x548C;&#x5173;&#x95ED;</h4><p>&#x4E0B;&#x9762;&#x662F;pg_ctl&#x547D;&#x4EE4;&#x7684;&#x4F7F;&#x7528;&#x65B9;&#x6CD5;&#x548C;&#x5E38;&#x7528;&#x9009;&#x9879;&#xFF0C;&#x9700;&#x8981;&#x6307;&#x51FA;&#x7684;&#x662F;&#xFF0C;&#x8BE5;&#x547D;&#x4EE4;&#x662F;postgres&#x547D;&#x4EE4;&#x7684;&#x5C01;&#x88C5;&#x4F53;&#xFF0C;&#x56E0;&#x6B64;&#x5728;&#x4F7F;&#x7528;&#x4E0A;&#x6BD4;&#x76F4;&#x63A5;&#x4F7F;&#x7528;postgres&#x66F4;&#x52A0;&#x65B9;&#x4FBF;&#x3002;      </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">pg_ctl init[db] [-D DATADIR] [-s] [-o &quot;OPTIONS&quot;]      </span><br><span class="line">pg_ctl start     [-w] [-t SECS] [-D DATADIR] [-s] [-l FILENAME] [-o &quot;OPTIONS&quot;]  </span><br><span class="line">pg_ctl stop     [-W] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]     </span><br><span class="line">pg_ctl restart  [-w] [-t SECS] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]     </span><br><span class="line">pg_ctl reload  [-D DATADIR] [-s]     </span><br><span class="line">pg_ctl status  [-D DATADIR]     </span><br><span class="line">pg_ctl promote [-D DATADIR] [-s]</span><br></pre></td></tr></table></figure>
<p>&#x8FD9;&#x91CC;&#x53EA;&#x662F;&#x7ED9;&#x51FA;&#x6700;&#x4E3A;&#x5E38;&#x7528;&#x7684;&#x4F7F;&#x7528;&#x65B9;&#x5F0F;&#xFF0C;&#x5373;&#x6570;&#x636E;&#x5E93;&#x670D;&#x52A1;&#x5668;&#x7684;&#x6B63;&#x5E38;&#x542F;&#x52A8;&#x548C;&#x5173;&#x95ED;&#x3002; </p>
<p>start&#x8868;&#x793A;&#x542F;&#x52A8;postgres&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x7A0B;&#x3002;<br>-D&#x6307;&#x5B9A;&#x6570;&#x636E;&#x5E93;&#x670D;&#x52A1;&#x5668;&#x7684;&#x521D;&#x59CB;&#x76EE;&#x5F55;&#x7684;&#x5B58;&#x653E;&#x8DEF;&#x5F84;&#x3002;<br>-l&#x6307;&#x5B9A;&#x6570;&#x636E;&#x5E93;&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x7A0B;&#x7684;&#x65E5;&#x5FD7;&#x6587;&#x4EF6;      </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/&gt; pg_ctl -w start -D /opt/PostgreSQL/9.4/data -l /opt/PostgreSQL/9.4/data/pg_log/startup.log</span><br></pre></td></tr></table></figure>
<p>stop&#x8868;&#x793A;&#x505C;&#x6B62;postgres&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x7A0B;<br>-m fast&#x5728;&#x5173;&#x95ED;&#x7CFB;&#x7EDF;&#x65F6;&#xFF0C;&#x4F7F;&#x7528;fast&#x7684;&#x5173;&#x95ED;&#x6A21;&#x5F0F;&#x3002;      </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/&gt; pg_ctl stop -m fast -w -D /opt/PostgreSQL/9.4/data</span><br></pre></td></tr></table></figure>
<h4 id="&#x4E8C;-&#x670D;&#x52A1;&#x5668;&#x57FA;&#x672C;&#x53C2;&#x6570;&#x76F8;&#x5173;&#x914D;&#x7F6E;"><a href="#&#x4E8C;&#x3001;&#x670D;&#x52A1;&#x5668;&#x57FA;&#x672C;&#x53C2;&#x6570;&#x76F8;&#x5173;&#x914D;&#x7F6E;" class="headerlink" title="&#x4E8C;&#x3001;&#x670D;&#x52A1;&#x5668;&#x57FA;&#x672C;&#x53C2;&#x6570;&#x76F8;&#x5173;&#x914D;&#x7F6E;"></a>&#x4E8C;&#x3001;&#x670D;&#x52A1;&#x5668;&#x57FA;&#x672C;&#x53C2;&#x6570;&#x76F8;&#x5173;&#x914D;&#x7F6E;</h4><p>&#x5728;PostgreSQL&#x4E2D;&#xFF0C;&#x6240;&#x6709;&#x914D;&#x7F6E;&#x53C2;&#x6570;&#x540D;&#x90FD;&#x662F;&#x5927;&#x5C0F;&#x5199;&#x4E0D;&#x654F;&#x611F;&#x7684;&#x3002;&#x6BCF;&#x4E2A;&#x53C2;&#x6570;&#x90FD;&#x53EF;&#x4EE5;&#x63A5;&#x53D7;&#x56DB;&#x79CD;&#x7C7B;&#x578B;&#x7684;&#x503C;&#xFF0C;&#x5B83;&#x4EEC;&#x5206;&#x522B;&#x662F;&#x5E03;&#x5C14;&#x3001;&#x6574;&#x6570;&#x3001;&#x6D6E;&#x70B9;&#x6570;&#x548C;&#x5B57;&#x7B26;&#x4E32;&#x3002;&#x5176;&#x4E2D;&#x5E03;&#x5C14;&#x503C;&#x53EF;&#x4EE5;&#x662F;ON&#x3001;OFF&#x3001;TRUE&#x3001;FALSE&#x3001;YES&#x3001;NO&#x3001;1&#x548C;0&#x3002;&#x5305;&#x542B;&#x8FD9;&#x4E9B;&#x53C2;&#x6570;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x662F;postgresql.conf&#xFF0C;&#x8BE5;&#x6587;&#x4EF6;&#x901A;&#x5E38;&#x5B58;&#x653E;&#x5728;initdb&#x521D;&#x59CB;&#x5316;&#x7684;&#x6570;&#x636E;(data)&#x76EE;&#x5F55;&#x4E0B;&#xFF0C;&#x89C1;&#x5982;&#x4E0B;&#x914D;&#x7F6E;&#x7247;&#x6BB5;&#xFF1A;      </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">log_connections = yes     </span><br><span class="line">log_destination = &apos;syslog&apos;     </span><br><span class="line">search_path = &apos;$user, public&apos;</span><br></pre></td></tr></table></figure>
<p>&#x4E95;&#x53F7;(#)&#x5F00;&#x59CB;&#x7684;&#x884C;&#x4E3A;&#x6CE8;&#x91CA;&#x884C;&#xFF0C;&#x5982;&#x679C;&#x914D;&#x7F6E;&#x503C;&#x4E2D;&#x5305;&#x542B;&#x6570;&#x5B57;&#xFF0C;&#x5219;&#x9700;&#x8981;&#x7528;&#x5355;&#x5F15;&#x53F7;&#x62EC;&#x8D77;&#x3002;&#x5982;&#x679C;&#x53C2;&#x6570;&#x503C;&#x672C;&#x8EAB;&#x5305;&#x542B;&#x5355;&#x5F15;&#x53F7;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5199;&#x4E24;&#x4E2A;&#x5355;&#x5F15;&#x53F7;(&#x63A8;&#x8350;&#x65B9;&#x6CD5;)&#x6216;&#x7528;&#x53CD;&#x659C;&#x625B;&#x5305;&#x56F4;&#x3002;<br>&#x8FD9;&#x91CC;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;&#x5E76;&#x975E;&#x6240;&#x6709;&#x914D;&#x7F6E;&#x53C2;&#x6570;&#x90FD;&#x53EF;&#x4EE5;&#x5728;&#x670D;&#x52A1;&#x5668;&#x8FD0;&#x884C;&#x65F6;&#x6267;&#x884C;&#x52A8;&#x6001;&#x4FEE;&#x6539;&#xFF0C;&#x6709;&#x4E9B;&#x53C2;&#x6570;&#x5728;&#x4FEE;&#x6539;&#x540E;&#xFF0C;&#x53EA;&#x80FD;&#x7B49;&#x5230;&#x670D;&#x52A1;&#x5668;&#x91CD;&#x65B0;&#x542F;&#x52A8;&#x540E;&#x624D;&#x80FD;&#x751F;&#x6548;&#x3002;<br>PostgreSQL&#x8FD8;&#x63D0;&#x4F9B;&#x4E86;&#x53E6;&#x5916;&#x4E00;&#x79CD;&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x53C2;&#x6570;&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x5373;&#x5728;&#x547D;&#x4EE4;&#x884C;&#x4E0A;&#x76F4;&#x63A5;&#x6267;&#x884C;&#x4FEE;&#x6539;&#x547D;&#x4EE4;&#xFF0C;&#x5982;&#xFF1A;     </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/&gt; postgres -c log_connections=yes -c log_destination=&apos;syslog&apos;</span><br></pre></td></tr></table></figure>
<p>&#x5982;&#x679C;&#x6B64;&#x65F6;&#x547D;&#x4EE4;&#x884C;&#x8BBE;&#x7F6E;&#x7684;&#x53C2;&#x6570;&#x548C;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x53C2;&#x6570;&#x76F8;&#x4E92;&#x51B2;&#x7A81;&#xFF0C;&#x90A3;&#x4E48;&#x547D;&#x4EE4;&#x884C;&#x4E2D;&#x7ED9;&#x51FA;&#x7684;&#x53C2;&#x6570;&#x5C06;&#x8986;&#x76D6;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x5DF2;&#x6709;&#x7684;&#x53C2;&#x6570;&#x503C;&#x3002;&#x9664;&#x6B64;&#x4E4B;&#x5916;&#xFF0C;&#x6211;&#x4EEC;&#x8FD8;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;ALTER DATABASE&#x548C;ALTER USER&#x7B49;PostgreSQL&#x7684;&#x6570;&#x636E;&#x5B9A;&#x4E49;&#x547D;&#x4EE4;&#x6765;&#x5206;&#x522B;&#x4FEE;&#x6539;&#x6307;&#x5B9A;&#x6570;&#x636E;&#x5E93;&#x6216;&#x6307;&#x5B9A;&#x7528;&#x6237;&#x7684;&#x914D;&#x7F6E;&#x4FE1;&#x606F;&#x3002;&#x5176;&#x4E2D;&#x9488;&#x5BF9;&#x6570;&#x636E;&#x5E93;&#x7684;&#x8BBE;&#x7F6E;&#x5C06;&#x8986;&#x76D6;&#x4EFB;&#x4F55;&#x4ECE;postgres&#x547D;&#x4EE4;&#x884C;&#x6216;&#x8005;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4ECE;&#x7ED9;&#x51FA;&#x7684;&#x8BBE;&#x7F6E;&#xFF0C;&#x7136;&#x540E;&#x53C8;&#x4F1A;&#x88AB;&#x9488;&#x5BF9;&#x7528;&#x6237;&#x7684;&#x8BBE;&#x7F6E;&#x8986;&#x76D6;&#xFF0C;&#x6700;&#x540E;&#x53C8;&#x90FD;&#x4F1A;&#x88AB;&#x6BCF;&#x4F1A;&#x8BDD;&#x7684;&#x9009;&#x9879;&#x8986;&#x76D6;&#x3002;&#x4E0B;&#x9762;&#x662F;&#x5F53;&#x670D;&#x52A1;&#x5668;&#x914D;&#x7F6E;&#x51FA;&#x73B0;&#x51B2;&#x7A81;&#x65F6;&#xFF0C;PostgreSQL&#x670D;&#x52A1;&#x5668;&#x5C06;&#x4F1A;&#x91C7;&#x7528;&#x54EA;&#x79CD;&#x65B9;&#x5F0F;&#x7684;&#x4F18;&#x5148;&#x7EA7;&#xFF0C;&#x5982;&#xFF1A;<br>1). &#x57FA;&#x4E8E;&#x4F1A;&#x8BDD;&#x7684;&#x914D;&#x7F6E;&#xFF1B;<br>2). &#x57FA;&#x4E8E;&#x7528;&#x6237;&#x7684;&#x914D;&#x7F6E;&#xFF1B;<br>3). &#x57FA;&#x4E8E;&#x6570;&#x636E;&#x5E93;&#x7684;&#x914D;&#x7F6E;&#xFF1B;<br>4). postgres&#x547D;&#x4EE4;&#x884C;&#x6307;&#x5B9A;&#x7684;&#x914D;&#x7F6E;&#xFF1B;<br>5). &#x914D;&#x7F6E;&#x6587;&#x4EF6;postgresql.conf&#x4E2D;&#x7ED9;&#x51FA;&#x7684;&#x914D;&#x7F6E;&#x3002;    </p>
<p>&#x6700;&#x540E;&#x9700;&#x8981;&#x8BF4;&#x660E;&#x7684;&#x662F;&#xFF0C;&#x6709;&#x4E9B;&#x8BBE;&#x7F6E;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;PostgreSQL&#x7684;set&#x547D;&#x4EE4;&#x8FDB;&#x884C;&#x8BBE;&#x7F6E;&#xFF0C;&#x5982;&#x5728;psql&#x4E2D;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x8F93;&#x5165;&#xFF1A;    </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">SET ENABLE_SEQSCAN TO OFF;</span><br></pre></td></tr></table></figure>
<p>&#x4E5F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;show&#x547D;&#x4EE4;&#x6765;&#x663E;&#x793A;&#x6307;&#x5B9A;&#x914D;&#x7F6E;&#x7684;&#x5F53;&#x524D;&#x503C;&#xFF0C;&#x5982;&#xFF1A; </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">SHOW ENABLE_SEQSCAN;</span><br></pre></td></tr></table></figure>
<p>&#x4E0E;&#x6B64;&#x540C;&#x65F6;&#xFF0C;&#x6211;&#x4EEC;&#x4E5F;&#x53EF;&#x4EE5;&#x624B;&#x5DE5;&#x67E5;&#x8BE2;pg_settings&#x7CFB;&#x7EDF;&#x8868;&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x68C0;&#x7D22;&#x611F;&#x5174;&#x8DA3;&#x7684;&#x7CFB;&#x7EDF;&#x53C2;&#x6570;&#x3002;</p>
<h4 id="&#x4E09;-&#x7CFB;&#x7EDF;&#x5185;&#x5B58;&#x4F18;&#x5316;&#x76F8;&#x5173;&#x914D;&#x7F6E;"><a href="#&#x4E09;&#x3001;&#x7CFB;&#x7EDF;&#x5185;&#x5B58;&#x4F18;&#x5316;&#x76F8;&#x5173;&#x914D;&#x7F6E;" class="headerlink" title="&#x4E09;&#x3001;&#x7CFB;&#x7EDF;&#x5185;&#x5B58;&#x4F18;&#x5316;&#x76F8;&#x5173;&#x914D;&#x7F6E;"></a>&#x4E09;&#x3001;&#x7CFB;&#x7EDF;&#x5185;&#x5B58;&#x4F18;&#x5316;&#x76F8;&#x5173;&#x914D;&#x7F6E;</h4><p>1&#x3001;shared_buffers(integer)</p>
<p>&#x8BBE;&#x7F6E;&#x6570;&#x636E;&#x5E93;&#x670D;&#x52A1;&#x5668;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x7684;&#x5171;&#x4EAB;&#x5185;&#x5B58;&#x6570;&#x91CF;&#x3002;&#x7F3A;&#x7701;&#x60C5;&#x51B5;&#x4E0B;&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x4E3A;32MB&#xFF0C;&#x4F46;&#x662F;&#x4E0D;&#x8981;&#x5C11;&#x4E8E;128KB&#x3002;&#x56E0;&#x4E3A;&#x8BE5;&#x503C;&#x8BBE;&#x7F6E;&#x7684;&#x8D8A;&#x9AD8;&#x5BF9;&#x7CFB;&#x7EDF;&#x7684;&#x6027;&#x80FD;&#x8D8A;&#x6709;&#x597D;&#x5904;&#x3002;&#x8BE5;&#x914D;&#x7F6E;&#x53C2;&#x6570;&#x53EA;&#x80FD;&#x5728;&#x6570;&#x636E;&#x5E93;&#x542F;&#x52A8;&#x65F6;&#x8BBE;&#x7F6E;&#x3002;&#x6B64;&#x65F6;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x6709;&#x4E00;&#x53F0;&#x4E13;&#x7528;&#x7684;&#x6570;&#x636E;&#x5E93;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x5176;&#x5185;&#x5B58;&#x4E3A;1G&#x6216;&#x8005;&#x66F4;&#x591A;&#xFF0C;&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x63A8;&#x8350;&#x5C06;&#x8BE5;&#x503C;&#x8BBE;&#x7F6E;&#x4E3A;&#x7CFB;&#x7EDF;&#x5185;&#x5B58;&#x7684;25%</p>
<p>2&#x3001;work_mem(integer)</p>
<p>PostgreSQL&#x5728;&#x6267;&#x884C;&#x6392;&#x5E8F;&#x64CD;&#x4F5C;&#x65F6;&#xFF0C;&#x4F1A;&#x6839;&#x636E;work_mem&#x7684;&#x5927;&#x5C0F;&#x51B3;&#x5B9A;&#x662F;&#x5426;&#x5C06;&#x4E00;&#x4E2A;&#x5927;&#x7684;&#x7ED3;&#x679C;&#x96C6;&#x62C6;&#x5206;&#x4E3A;&#x51E0;&#x4E2A;&#x5C0F;&#x7684;&#x548C;work_mem&#x5DEE;&#x4E0D;&#x591A;&#x5927;&#x5C0F;&#x7684;&#x4E34;&#x65F6;&#x6587;&#x4EF6;&#x3002;&#x663E;&#x7136;&#x62C6;&#x5206;&#x7684;&#x7ED3;&#x679C;&#x662F;&#x964D;&#x4F4E;&#x4E86;&#x6392;&#x5E8F;&#x7684;&#x901F;&#x5EA6;&#x3002;&#x56E0;&#x6B64;&#x589E;&#x52A0;work_mem&#x6709;&#x52A9;&#x4E8E;&#x63D0;&#x9AD8;&#x6392;&#x5E8F;&#x7684;&#x901F;&#x5EA6;&#x3002;&#x7136;&#x800C;&#x9700;&#x8981;&#x6307;&#x51FA;&#x7684;&#x662F;&#xFF0C;&#x5982;&#x679C;&#x7CFB;&#x7EDF;&#x4E2D;&#x540C;&#x65F6;&#x5B58;&#x5728;&#x591A;&#x4E2A;&#x6392;&#x5E8F;&#x64CD;&#x4F5C;&#xFF0C;&#x90A3;&#x4E48;&#x6BCF;&#x4E2A;&#x64CD;&#x4F5C;&#x5728;&#x6392;&#x5E8F;&#x65F6;&#x4F7F;&#x7528;&#x7684;&#x5185;&#x5B58;&#x6570;&#x91CF;&#x5747;&#x4E3A;work_mem&#xFF0C;&#x56E0;&#x6B64;&#x5728;&#x6211;&#x4EEC;&#x8BBE;&#x7F6E;&#x8BE5;&#x503C;&#x65F6;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x8FD9;&#x4E00;&#x95EE;&#x9898;</p>
<p>3&#x3001;maintence_work_mem(integer)</p>
<p>&#x6307;&#x5B9A;&#x5728;&#x7EF4;&#x62A4;&#x6027;&#x64CD;&#x4F5C;&#x4E2D;&#x4F7F;&#x7528;&#x7684;&#x6700;&#x5927;&#x5185;&#x5B58;&#x6570;&#xFF0C;&#x5982;VACUUM&#x3001;CREATE INDEX&#x548C;ALTER TABLE ADD FOREIGN KEY&#x7B49;&#xFF0C;<br>&#x8BE5;&#x914D;&#x7F6E;&#x7684;&#x7F3A;&#x7701;&#x503C;&#x4E3A;16MB&#x3002;&#x56E0;&#x4E3A;&#x6BCF;&#x4E2A;&#x4F1A;&#x8BDD;&#x5728;&#x540C;&#x4E00;&#x65F6;&#x523B;&#x53EA;&#x80FD;&#x6267;&#x884C;&#x4E00;&#x4E2A;&#x8BE5;&#x64CD;&#x4F5C;&#xFF0C;&#x6240;&#x4EE5;&#x4F7F;&#x7528;&#x7684;&#x9891;&#x7387;&#x4E0D;&#x9AD8;&#xFF0C;&#x4F46;&#x662F;&#x8FD9;&#x4E9B;&#x6307;&#x4EE4;&#x5F80;&#x5F80;&#x6D88;&#x8017;&#x8F83;&#x591A;&#x7684;&#x7CFB;&#x7EDF;&#x8D44;&#x6E90;&#xFF0C;&#x56E0;&#x6B64;&#x5E94;&#x8BE5;&#x5C3D;&#x5FEB;&#x8BA9;&#x8FD9;&#x4E9B;&#x6307;&#x4EE4;&#x5FEB;&#x901F;&#x6267;&#x884C;&#x5B8C;&#x6BD5;</p>
<h4 id="&#x56DB;-&#x5E38;&#x89C1;&#x95EE;&#x9898;&#x53C2;&#x6570;&#x4E3E;&#x4F8B;"><a href="#&#x56DB;&#x3001;&#x5E38;&#x89C1;&#x95EE;&#x9898;&#x53C2;&#x6570;&#x4E3E;&#x4F8B;" class="headerlink" title="&#x56DB;&#x3001;&#x5E38;&#x89C1;&#x95EE;&#x9898;&#x53C2;&#x6570;&#x4E3E;&#x4F8B;"></a>&#x56DB;&#x3001;&#x5E38;&#x89C1;&#x95EE;&#x9898;&#x53C2;&#x6570;&#x4E3E;&#x4F8B;</h4><p>&#x5728;&#x4F7F;&#x7528;PostGreSQL&#x8FDB;&#x884C;&#x56E2;&#x961F;&#x9879;&#x76EE;&#x5F00;&#x53D1;&#x65F6;&#xFF0C;&#x80AF;&#x5B9A;&#x4F1A;&#x9047;&#x5230;&#x7C7B;&#x4F3C;&#x8FDC;&#x7A0B;&#x8BBF;&#x95EE;&#x6570;&#x636E;&#x3001;&#x6570;&#x636E;&#x5E93;&#x94FE;&#x63A5;&#x9650;&#x5236;&#x8FD9;&#x6837;&#x7684;&#x9700;&#x6C42;&#xFF0C;&#x5F53;&#x7136;PostGreSQL&#x672C;&#x8EAB;&#x80AF;&#x5B9A;&#x4E0D;&#x4F1A;&#x9ED8;&#x8BA4;&#x5F00;&#x542F;&#x8FD9;&#x4E9B;&#x529F;&#x80FD;&#x7684;&#xFF0C;&#x6240;&#x4EE5;&#x9700;&#x8981;&#x624B;&#x52A8;&#x8C03;&#x6574;&#x53C2;&#x6570;&#x3002;</p>
<p>1&#x3001;&#x5F00;&#x542F;&#x8FDC;&#x7A0B;&#x8BBF;&#x95EE;&#x6570;&#x636E;&#x5E93;&#x6743;&#x9650;&#x9700;&#x8981;&#x505A;&#x5982;&#x4E0B;&#x64CD;&#x4F5C;</p>
<p>pg_hba.conf &#x6587;&#x4EF6;&#x4E2D;&#xFF1A;</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># IPv4 local connections:  </span><br><span class="line">host    all             all             127.0.0.1/32            md5  </span><br><span class="line">host    all             all             0.0.0.0/0            md5</span><br></pre></td></tr></table></figure>
<p>&#x7B2C;&#x4E00;&#x884C;&#x4E3A;&#x6307;&#x5B9A;IP&#x6307;&#x5B9A;&#xFF0C;&#x7B2C;&#x4E8C;&#x884C;&#x4E3A;&#x6240;&#x6709;IP&#xFF0C;&#x4E00;&#x822C;&#x60C5;&#x51B5;&#x4E0B;&#x662F;&#x4E0D;&#x5F00;&#x542F;&#x6240;&#x6709;IP&#x6743;&#x9650;&#x7684;&#xFF0C;&#x56E0;&#x4E3A;&#x5B89;&#x5168;&#x3002;</p>
<p>postgresql.conf &#x6587;&#x4EF6;&#x4E2D;&#xFF1A;</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">listen_addresses = &apos;*&apos;      # what IP address(es) to listen on;</span><br></pre></td></tr></table></figure>
<p>&#x9ED8;&#x8BA4;&#x662F;&#x2018;*&#x2019; &#x76D1;&#x542C;&#x6240;&#x6709;&#x6765;&#x6E90;&#x3002;</p>
<p>2&#x3001;&#x4FEE;&#x6539;&#x670D;&#x52A1;&#x5668;&#x8FDE;&#x63A5;&#x9650;&#x5236;&#x9700;&#x8981;&#x505A;&#x5982;&#x4E0B;&#x64CD;&#x4F5C;</p>
<p>postgresql.conf &#x6587;&#x4EF6;&#x4E2D;&#xFF1A;</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">max_connection=1000</span><br></pre></td></tr></table></figure>
<p>1000&#x5373;&#x4E3A;&#x6700;&#x5927;&#x5BA2;&#x6237;&#x7AEF;&#x8FDE;&#x63A5;&#x6570;&#x3002;</p>
<p>&#x4EE5;&#x4E0A;&#x5C31;&#x662F;&#x5E38;&#x7528;&#x7684;&#x4E00;&#x4E9B;&#x7CFB;&#x7EDF;&#x914D;&#x7F6E;&#xFF0C;&#x5F53;&#x7136;&#x8FD8;&#x6709;&#x597D;&#x591A;&#x597D;&#x591A;&#xFF0C;&#x8FD9;&#x4E48;&#x5927;&#x7684;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x5E93;&#x7CFB;&#x7EDF;&#x4E0D;&#x53EF;&#x80FD;&#x5C31;&#x8FD9;&#x4E00;&#x70B9;&#x70B9;&#xFF0C;&#x4EE5;&#x4E0A;&#x53EA;&#x662F;&#x5217;&#x51FA;&#x5E38;&#x7528;&#x914D;&#x7F6E;&#xFF0C;&#x4EE5;&#x540E;&#x80AF;&#x5B9A;&#x4F1A;&#x9047;&#x5230;&#x5176;&#x4ED6;&#x5404;&#x79CD;&#x914D;&#x7F6E;&#xFF0C;&#x6162;&#x6162;&#x5B66;&#x4E60;&#x8FDB;&#x6B65;&#x4E2D;&#x3002;&#x3002;&#x3002;</p>

            </div>
        </div>
    </div>
</article>  
<div class="card"> 
	 <nav id="pagination" class="indigo" >
		
		<a style="float: left;" href="/qianmeng/2015/06/27/Apache  CXF 应用小结/" >&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-arrow-left"></i>&nbsp;&nbsp;上一页</a>
		
		
		<a style="float: right;" href="/qianmeng/2015/06/17/PostGreSQL 结合 Hibernate 在项目中的使用小结/" >&nbsp;&nbsp;&nbsp;&nbsp;下一页&nbsp;&nbsp;<i class="fa fa-arrow-right"></i>&nbsp;&nbsp;&nbsp;&nbsp;</a>
		
		<div class="clearfix"></div>
	</nav> 
</div>





    <section id="comment">
        <div class="card">
            <div class="card-content">
                <!-- Duoshuo Comment BEGIN -->
                <div class="ds-thread" data-thread-key="2015/06/18/PostGreSQL 之服务器配置/" data-title="PostGreSQL 之服务器配置" data-url="https://kidmid.gitee.io/qianmeng/qianmeng/2015/06/18/PostGreSQL 之服务器配置/"></div>

                <script type="text/javascript">
                    console.log(document.querySelector('.ds-thread'));
                    var duoshuoQuery = {
                        short_name: 'kidmid'
                    };
                    (function() {
                        var ds = document.createElement('script');
                        ds.type = 'text/javascript';
                        ds.async = true;
                        ds.src = (document.location.protocol == 'https:'
                            ? 'https:'
                            : 'http:') + '//static.duoshuo.com/embed.js';
                        ds.charset = 'UTF-8';
                        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds);
                    })();
                </script>
                <!-- Duoshuo Comment END -->
            </div>
        </div>
    </section>



</div>

        <div class="fixed-action-btn float-sitemap">
    <a class="btn-floating btn-large pink">
      <i class="fa fa-caret-square-o-up"></i>
    </a>
    <ul>
      <li><a class="btn-return-top btn-floating waves-effect green" title="回到顶部"><i class="fa fa-arrow-circle-o-up"></i></a></li>
      <li><a class="btn-floating waves-effect button-collapse yellow darken-1"  data-activates="main-menu" title="menu"><i class="fa fa-navicon"></i></a></li>
    </ul>
  </div>

    </main>
    <footer class="page-footer indigo darken-1">
    
    <div class="container">
        <div class="row">
            
            <div class="social-group col m3 s12">
                <h5 class="white-text">社交</h5>
                
                    <a class="social-link" href="https://github.com/qianmeng" target="_blank">
                        <i class="fa fa-2x fa-github"></i>
                    </a>
                
                    <a class="social-link" href="http://weibo.com/u/1819068247" target="_blank">
                        <i class="fa fa-2x fa-weibo"></i>
                    </a>
                
                    <a class="social-link" href="/atom.xml" target="_blank">
                        <i class="fa fa-2x fa-rss"></i>
                    </a>
                
            </div>
            

            
            <div class="col m9 s12">
                <h5 class="white-text">友情链接</h5>
                
                    <a class="social-link" href="http://blog.csdn.net/qian_meng" target="_blank">CSDN 地址</a>
                
                    <a class="social-link" href="https://github.com/qianmeng" target="_blank">Github地址</a>
                
            </div>
            
        </div>
    </div>
    

    <div class="footer-copyright pink-link-context">
        <div class="container">
            © 2016  All rights reserved. 
        </div>
    </div>
</footer> 
<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>


    <noscript>
    <div class="noscript">
        <p class="center-align">当前网速较慢或者你使用的浏览器不支持博客特定功能，请尝试刷新或换用Chrome、Firefox等现代浏览器</p>
    </div>
</noscript>
<div class="noscript">
    <p class="center-align">当前网速较慢或者你使用的浏览器不支持博客特定功能，请尝试刷新或换用Chrome、Firefox等现代浏览器</p>
</div>


<script src="/qianmeng/js/jquery-2.1.1.min.js"></script>
<script src="/qianmeng/js/materialize.min.js"></script>

<script>
    (function($) {
        $(document).ready(function() {
            // 隐藏禁用javascript（针对微信内置浏览器）的提示
            $('.noscript').hide();

            // 图片缩放效果
            var $imgs = $('img').not('.slider-image').not('.avatar-image').not('.carousel-image').not('.card-cover-image').not('.qrcode');

            // 给图片加上点击放大效果（materialbox插件）
            $imgs.addClass('materialboxed').each(function(i, el) {
                $(this).attr('data-caption', $(this).attr('alt') || ' ');
            }).materialbox();

            // 优化表格的显示
            $('table').each(function() {
                var $table = $(this);
                // 除去多行代码的情况
                if ($table.find('pre').length == 0) {
                    $table.addClass('responsive-table striped bordered');
                }
            });

            // 首页幻灯片
            $('.slider').slider({indicators: true, full_width: true, interval: 8000});

            $(".button-collapse").sideNav();
            $(".category-menu").sideNav();

            // 针对gallery post
            $('.carousel').carousel({full_width: true});
            $('.carousel-control.prev').click(function() {
                $('.carousel').carousel('prev');
            });
            $('.carousel-control.next').click(function() {
                $('.carousel').carousel('next');
            });

            // 文章目录
            $('article').not('.simple-article').find('h1').add('h2').add('h3').add('h4').add('h5').add('h6').scrollSpy();
            // 修正文章目录的left-border颜色
            var color = $('.table-of-contents-text').css('color');
            $('.table-of-contents-link').css('border-left-color', color);

            // 针对移动端做的优化：FAB按钮点击一下收回
            if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
                $('.fixed-action-btn').addClass('click-to-toggle');
            }
            // 回到顶部
            $('.btn-return-top').click(function() {
                $('body, html').animate({
                    scrollTop: 0
                }, 500);
            });

            // 重置读书页面的Tab标签页的颜色
            $('li.tab a').hover(function() {
                $(this).toggleClass('text-lighten-4');
            });
            $('.indicator').addClass('pink lighten-2');

            
            // 添加new标签
            $('.menu-search').append('<span class="new badge pink"></span>');
            

            // 搜索功能
            $('.modal-trigger').leanModal();
            var searchXml = "search.xml";
            if (searchXml.length == 0) {
             	searchXml = "search.xml";
            }
            var searchPath = "/qianmeng/" + searchXml;
            initSearch(searchPath, 'search-input', 'search-result');
        });

        // 初始化搜索与匹配函数
        var initSearch = function(path, search_id, content_id) {
            'use strict';
            $.ajax({
                url: path,
                dataType: "xml",
                success: function(xmlResponse) {
                    // get the contents from search data
                    var datas = $("entry", xmlResponse).map(function() {
                        return {
                            title: $("title", this).text(),
                            content: $("content", this).text(),
                            url: $("url", this).text()
                        };
                    }).get();
                    var $input = document.getElementById(search_id);
                    var $resultContent = document.getElementById(content_id);
                    $input.addEventListener('input', function() {
                        var str = '<ul class=\"search-result-list\">';
                        var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                        $resultContent.innerHTML = "";
                        if (this.value.trim().length <= 0) {
                            return;
                        }
                        // perform local searching
                        datas.forEach(function(data) {
                            var isMatch = true;
                            var content_index = [];
                            var data_title = data.title.trim().toLowerCase();
                            var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                            var data_url = data.url;
                            var index_title = -1;
                            var index_content = -1;
                            var first_occur = -1;
                            // only match artiles with not empty titles and contents
                            if (data_title != '' && data_content != '') {
                                keywords.forEach(function(keyword, i) {
                                    index_title = data_title.indexOf(keyword);
                                    index_content = data_content.indexOf(keyword);
                                    if (index_title < 0 && index_content < 0) {
                                        isMatch = false;
                                    } else {
                                        if (index_content < 0) {
                                            index_content = 0;
                                        }
                                        if (i == 0) {
                                            first_occur = index_content;
                                        }
                                    }
                                });
                            }
                            // show search results
                            if (isMatch) {
                                keywords.forEach(function(keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    data_title = data_title.replace(regS, "<span class=\"search-keyword pink lighten-2\">" + keyword + "</span>");
                                });

                                str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                                var content = data.content.trim().replace(/<[^>]+>/g, "");
                                if (first_occur >= 0) {
                                    // cut out 100 characters
                                    var start = first_occur - 20;
                                    var end = first_occur + 80;
                                    if (start < 0) {
                                        start = 0;
                                    }
                                    if (start == 0) {
                                        end = 100;
                                    }
                                    if (end > content.length) {
                                        end = content.length;
                                    }
                                    var match_content = content.substring(start, end);
                                    // highlight all keywords
                                    keywords.forEach(function(keyword) {
                                        var regS = new RegExp(keyword, "gi");
                                        match_content = match_content.replace(regS, "<span class=\"search-keyword pink lighten-2\">" + keyword + "</span>");
                                    });

                                    str += "<p class=\"search-result\">..." + match_content + "...</p>"
                                }
                                str += "</li>";
                            }
                        });
                        str += "</ul>";
                        $resultContent.innerHTML = str;
                    });
                }
            });
        }
    })(jQuery);
</script>


<script src="/qianmeng/js/prettify.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $("pre").addClass("prettyprint");
        prettyPrint();
    });
</script>




<script type="text/javascript" src="http://tajs.qq.com/stats?sId=56073371" charset="UTF-8"></script>



<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
  src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>



	<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"slide":{"type":"slide","bdImg":"6","bdPos":"right","bdTop":"145"},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>

</body>
</html>
